{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b88fb6b1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "课程表\n",
      "今天是周 0\n",
      "4-5节 大学英语\n",
      "8-10节 Python语言\n"
     ]
    }
   ],
   "source": [
    "print(\"课程表\")\n",
    "import datetime\n",
    "time = datetime.datetime.today().weekday()\n",
    "week_time = int(time)\n",
    "print(\"今天是周\",week_time)\n",
    "if week_time==0:\n",
    "    print(\"4-5节 大学英语\");print(\"8-10节 Python语言\")\n",
    "elif week_time==1:\n",
    "    print(\"3-5节 创业基础（实践）\");print(\"8-9节 新媒体时代的新闻评论\");print(\"12-13节 法国文学导读\")\n",
    "elif week_time==2:\n",
    "    print(\"3-5节 融合新闻学\");print(\"12-13节 大学英语\")\n",
    "elif week_time==3:\n",
    "    print(\"4-5节毛概实践\")\n",
    "elif week_time==4:\n",
    "    print(\"1-2节 AI软件应用\");print(\"4-5节 大学体育\");print(\"8-10节 毛概理论\")\n",
    "else:\n",
    "    print(\"今天你没有课程安排\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "2047431d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9*9乘法表\n",
      "\n",
      "1*1=1 \n",
      "\n",
      "2*1=2 2*2=4 \n",
      "\n",
      "3*1=3 3*2=6 3*3=9 \n",
      "\n",
      "4*1=4 4*2=8 4*3=12 4*4=16 \n",
      "\n",
      "5*1=5 5*2=10 5*3=15 5*4=20 5*5=25 \n",
      "\n",
      "6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36 \n",
      "\n",
      "7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49 \n",
      "\n",
      "8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64 \n",
      "\n",
      "9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81 \n"
     ]
    }
   ],
   "source": [
    "print(\"9*9乘法表\")\n",
    "for a in range(1,10):  # a的循环在1-9之间刚好循环9次符合乘法口诀表\n",
    "    print()\n",
    "    for b in range(1,a+1):   #b的循环如果在1-10的话 就会有重复遍，所以我们用a来限制 range(a) 则表示循环值为0  到 a-1 ，但这不是我们想要的 因为它从0开始了而乘法表中不包含0，并且只到8就结束了。 \n",
    "        sum=a*b              # 所以我们想要让它取值在1-a的 所以范围就是（1，a+1）*乘法表也都是从1开始\n",
    "        print(str(a)+\"*\"+str(b)+\"=\"+str(sum),end=\" \")  #end作为每个式子衔接的位置\n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5d6e2470",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "课程表查询系统\n",
      "现在的时间是： 2021/09/21 17:03 Tuesday\n",
      "请输入要查询的星期:2\n",
      "请输入需要查询的时间(省略中间字符，只要输入值)：1500\n",
      "新媒体时代的评论\n"
     ]
    }
   ],
   "source": [
    "print(\"课程表查询系统\")\n",
    "\n",
    "import time\n",
    "now_time1 = time.strftime(\"%Y/%m/%d\")\n",
    "now_time2 = time.strftime(\"%H:%M\")\n",
    "now_time3 = time.strftime(\"%A\")\n",
    "print(\"现在的时间是：\",now_time1,now_time2,now_time3)\n",
    "\n",
    "weekday=int(input(\"请输入要查询的星期:\")) \n",
    "classtime=int(input(\"请输入需要查询的时间(省略中间字符，只要输入值)：\"))\n",
    "if weekday == 1 :\n",
    "    if 1035 < classtime < 1200 :\n",
    "        print(\" 大英\")\n",
    "    elif 1430 < classtime < 1610 :\n",
    "        print(\" Python语言 \")\n",
    "    else:\n",
    "        print(\"现在没有课程安排\")\n",
    "elif weekday == 2 :\n",
    "    if 945 < classtime <1200:\n",
    "        print(\"创业基础（实践）\")\n",
    "    elif 1430 < classtime < 1655:\n",
    "         print(\"新媒体时代的评论\")\n",
    "    elif 1845 < classtime < 2010:\n",
    "        print(\"法国文学导读\")\n",
    "    else:\n",
    "        print(\"没有课程安排\")\n",
    "elif weekday == 3 :\n",
    "    if 945 < classtime < 1200:\n",
    "        print(\"融合新闻学\")\n",
    "    elif 1845 < classtime < 2010:\n",
    "        print(\"大英\")\n",
    "    else:\n",
    "        print(\"该时间没有课程安排\")\n",
    "elif weekday == 4 :\n",
    "    if 1035 < classtime < 1200:\n",
    "        print(\"毛概实践\")\n",
    "    else:\n",
    "        print(\"该时间没有课程安排\")\n",
    "elif weekday == 5 :\n",
    "    if 800 < classtime < 925:\n",
    "        print(\"AI软件基础应用\")\n",
    "    elif 1035 < classtime < 1200:\n",
    "        print(\"体育（武术）\")\n",
    "    elif 1430 < classtime < 1655:\n",
    "        print(\"毛概理论\")\n",
    "    else:\n",
    "        print(\"该时间没有课程安排\")\n",
    "else:\n",
    "    print(\"周末\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a31e2c2a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
